<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    //基本
    let [a, b, c] = [1, 2, 3]
    console.log(a, b, c);
    //可嵌套
    let [num1, [[num2], num3]] = [111, [[222], 333]]
    console.log(num1, num2, num3);
    //可忽略
    let [x, y] = [1, 2, 3]
    console.log(x, y);
    //剩余运算符
    let [m, ...n] = [1, 2, 3, 45, 6, 7, 8]
    console.log(m, n);
    //解构默认值
    let [a1 = 1, b1 = a1] = [1]
    console.log(a1, b1);
    //字符串等
    let [d, e, f, g, h] = '12345'
    console.log(d, e, f, g, h);
  </script>
</body>

</html>